﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class Controls_ucImageRoller : System.Web.UI.UserControl
{
    public string strImageList = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DirectoryInfo imgInfo = new DirectoryInfo(Server.MapPath("~/Images/slideshow"));
            FileInfo[] fileinDir = imgInfo.GetFiles();
            
            for (int i = 0; i < fileinDir.Length; i++)
            {
                if (fileinDir[i].Extension.ToString().ToLower().Equals(".png") || fileinDir[i].Extension.ToString().ToLower().Equals(".jpg"))
                {
                    strImageList = strImageList + "<img src=\"images/slideshow/" + fileinDir[i].Name + "\" width=\"185\" height=\"165\" />";
                }
            }
        }
    }
}